<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

//经验记录表
class ExperienceRecord extends Model
{
    public $timestamps = false;

    protected $table = 'experience_record';

    protected $primaryKey = 'experience_recordID';

    protected $fillable = [
        'experience_recordID',
        'userID', //用户id
        'taskID', //任务id
        'value', //经验值
        'time', //时间
    ];

    //关联任务表
    public function task()
    {
        return $this->hasOne('App\\Models\\Task', 'taskID', 'taskID');
    }
}
